package top.yuzt.noticeserver.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.io.File;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    private final String ROOT_PATH = System.getProperty("user.dir") + File.separator + "Local_files\\";

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/Local_files/**")
                .addResourceLocations("file:" + ROOT_PATH);
    }
}
